﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RechContact.aspx.cs" Inherits="RechContact" %>


<asp:content ContentPlaceHolderID="contenu" runat="server">
    <fieldset id="custom">
        <legend>Recherche</legend>
        <table> 
            <asp:panel ID="panel" runat="server" Enabled="true">       
                <tr>
                    <td>
                        <asp:Label ID="lbNom" runat="server" AssociatedControlID="tbNom" Text="Nom : " />
                    </td>
                    <td>
                        <asp:TextBox ID="tbNom" runat="server" Width="250px" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lbPrenom" runat="server" AssociatedControlID="tbPrenom" Text="Prénom :"/>
                    </td>
                    <td>
                        <asp:TextBox ID="tbPrenom" runat="server" Width="250px" />
                    </td>            
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lbVillePerso" runat="server" AssociatedControlID="tbVillePerso" Text="Ville (Perso) :"/>
                    </td>
                    <td>
                        <asp:TextBox ID="tbVillePerso" runat="server" Width="250px" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="Label1" runat="server" AssociatedControlID="tbVillePro" Text="Ville (Pro) :" />
                    </td>
                    <td>
                        <asp:TextBox ID="tbVillePro" runat="server" Width="250px"/>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lbSociete" runat="server" AssociatedControlID="tbSociete" Text="Société : " />
                    </td>
                    <td>
                        <asp:TextBox ID="tbSociete" runat="server" Width="250px" />
                    </td>
                </tr>
            </asp:panel>
            
                <tr>
                    <td align="left">
                        <asp:Button ID="btCreer" runat="server" onclick="btCreer_Click" Text="Créer" 
                            Visible="False" />
                    </td>
                    <td align="right">    
                        <asp:Button ID="btReinitiliser" runat="server" Text="Reinitialiser" 
                            Visible="False" onclick="btReinitiliser_Click1" />
                        
                        <asp:Button ID="btAffiner" runat="server" Text="Affiner" 
                            onclick="btAffiner_Click" Visible="False" />
                            
                        <asp:Button ID="btRechercher" runat="server" onclick="btRechercher_Click" 
                            Text="Rechercher" />                
                    </td>            
                </tr>
        </table>
    </fieldset>
    <br /><br />
    <asp:Label ID="lbNbResult" runat="server"
        SkinID="NbResult" Visible="false"
    />    
    <br /><br />    
    <asp:GridView ID="gvResult" runat="server" Width="80%"                      
        AutoGenerateColumns="False" 
        onpageindexchanging="gvResult_PageIndexChanging"
        PagerStyle-HorizontalAlign="Right" 
        OnRowDeleting="gvResult_RowDeleting" DataKeyNames="Id">                
        
        <Columns>
            <asp:HyperLinkField HeaderText="Identifiant" 
                    DataNavigateUrlFormatString="AffContactPerso.aspx?id={0}" 
                    DataTextField="Id" DataNavigateUrlFields="Id" />
            <asp:BoundField DataField="Nom" HeaderText="Nom" SortExpression="Nom"/>
            <asp:BoundField DataField="Prenom" HeaderText="Prénom" SortExpression="Prenom" />
            <asp:BoundField DataField="VillePerso" HeaderText="Ville (perso)" SortExpression="VillePerso" />
            <asp:BoundField DataField="VillePro" HeaderText="Ville (pro)" SortExpression="VillePro" />
            <asp:BoundField DataField="Societe" HeaderText="Société" SortExpression="Societe" />
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:LinkButton ID="btSupprimer" Text="Supprimer" runat="server"
                            OnClientClick="return confirm('Êtes-vous sur de vouloir supprimer ce contact ?');"
                            CommandName="Delete" Visible="true"/>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>

<PagerStyle HorizontalAlign="Right"></PagerStyle>
    </asp:GridView>
</asp:content>   
